package com.yunwushanhe.student.controller;

import com.yunwushanhe.student.bean.ManagerToken;
import com.yunwushanhe.student.bean.req.ManagerLoginReq;
import com.yunwushanhe.student.bean.ret.Result;
import com.yunwushanhe.student.service.ManagerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 这个类主要是指用户（）
 */
@Slf4j
@RestController
@RequestMapping("/manager")
public class ManagerController {

    @Resource
    private ManagerService managerService;

    @PostMapping("/login")
    public Result<ManagerToken> login(@RequestBody @Validated ManagerLoginReq loginReq){
        log.info("{}",loginReq);
        return managerService.login(loginReq);
    }

}
